<div id="actionbar" class="fn-clear">
    <form id="form" action="{:url('popupshop/saleHouse/select')}" method="get">
        <input type="hidden" name="input" value="{$input}"/>
        <input placeholder="请输入商品关键字" class="input w200" type="text" name="keyword" value="{$keyword}" />
        <input type="submit" value="搜索" class="button button-blue" />
    </form> 
</div>
<table class="pure-table">
    <thead>
        <tr>
            <th class="fn-tac w80">#</th>
            <th class="fn-tac w90">选择</th>
            <th class="fn-tac w80">商品名称</th>
            <th></th>
            <th class="w100 fn-tar">成本价</th>
            <th class="w100 fn-tar">销售价</th>
            <th class="w140">更新时间</th>
        </tr>
    </thead>
    <tbody>
    {foreach $lists as $vo}
    <tr>
        <td class="fn-tac">{$vo.id}</td>
        <td class="fn-tac"><a href="javascript:;" class="button select" id="{$vo.id}">选择</a></td>
        <td class="fn-tac"><img src="{$vo.img}?x-oss-process=style/80" class="w60" /></td>
        <td>
            <span class="fn-fb">【{$vo.category.title}】</span>
            <a href="{:url('popupshop/saleHouse/edit',['id'=>$vo.id,'keyword'=>$keyword])}">{$vo.name}</a><br />
            <span class="gray">{$vo.note}</span>
        </td>
        </td>
        <td class="fn-tar">￥{$vo.cost_price}</td>
        <td class="fn-tar"><span class="red">￥{$vo.sell_price}</span></td>
        <td>{$vo.update_time|date='Y-m-d H:i'}</td>
    </tr>
    {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
Do('base','layer',function (){
    var index = parent.layer.getFrameIndex(window.name); 
    $(".select").click(function(){
        var ids =  $(this).attr('id')
        parent.$("#iframe")[0].contentWindow.items(ids,'{$input}');
        parent.layer.close(index);
    });
})
</script>